package com.google.gwt.gfx.client.style;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.IsWidget;

public abstract class GFXStyle {

	private IsWidget buddyRef;

	private Element elementRef;

	protected GFXStyle(IsWidget buddy) {
		buddyRef = buddy;
		elementRef = buddyRef.asWidget().getElement();
	}

	protected GFXStyle(IsWidget buddy, Element element) {
		buddyRef = buddy;
		elementRef = element;
		DOM.appendChild(buddyRef.asWidget().getElement(), elementRef);
	}

	public IsWidget buddy() {
		return buddyRef;
	}

	public Element element() {
		return elementRef;
	}

}
